[feat] 대화방 제목 지정/수정 API - #54
Conversation
- Conversation에 nullable title(ConversationTitle 값 객체, 공백트림·최대100자)
- PATCH /api/conversations/{id}/title — 본인 대화방, 여러 번 수정 가능, 삭제된 방 차단
- 새 대화방은 title=null, ConversationResponse에 title 포함
- V9 마이그레이션(conversations.title)
Test Coverage
|
|
Warning Review limit reached
Next review available in: 53 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
Walkthrough대화방에 nullable 제목 필드와 Changes대화방 제목 기능
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant ConversationController
participant ConversationService
participant Conversation
Client->>ConversationController: PATCH /api/conversations/{conversationId}/title
ConversationController->>ConversationService: updateTitle(memberId, conversationId, title)
ConversationService->>Conversation: rename(ConversationTitle(title))
Conversation-->>ConversationService: updated conversation
ConversationService-->>ConversationController: Conversation
ConversationController-->>Client: ApiResponse<ConversationResponse>
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@src/main/kotlin/com/nexters/gamss/conversation/controller/dto/UpdateConversationTitleRequest.kt`:
- Around line 7-9: Update UpdateConversationTitleRequest validation so blank or
whitespace-only titles are handled by ConversationTitle and return
INVALID_CONVERSATION_TITLE instead of being intercepted as INVALID_INPUT; remove
or adjust the conflicting NotBlank validation or align its
MethodArgumentNotValidException mapping. Add integration coverage for
whitespace-only and overlength titles to verify both cases use the contracted
error code.
In
`@src/main/kotlin/com/nexters/gamss/conversation/service/ConversationService.kt`:
- Around line 71-81: Update updateTitle to load the conversation through
getOwnedConversationForUpdate instead of getOwnedConversation, preserving the
existing ownership validation and rename flow so title changes use the same
row-level lock as deletion.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 0b70411f-27eb-44da-81e6-25cd10b58b7b
📒 Files selected for processing (10)
src/main/kotlin/com/nexters/gamss/conversation/controller/ConversationController.ktsrc/main/kotlin/com/nexters/gamss/conversation/controller/dto/ConversationResponse.ktsrc/main/kotlin/com/nexters/gamss/conversation/controller/dto/UpdateConversationTitleRequest.ktsrc/main/kotlin/com/nexters/gamss/conversation/domain/Conversation.ktsrc/main/kotlin/com/nexters/gamss/conversation/domain/ConversationTitle.ktsrc/main/kotlin/com/nexters/gamss/conversation/service/ConversationService.ktsrc/main/kotlin/com/nexters/gamss/global/exception/ErrorCode.ktsrc/main/resources/db/migration/V9__conversation_title.sqlsrc/test/kotlin/com/nexters/gamss/conversation/controller/ConversationControllerIntegrationTest.ktsrc/test/kotlin/com/nexters/gamss/conversation/domain/ConversationTitleTest.kt
- updateTitle이 getOwnedConversationForUpdate(행 잠금) 사용 — 잠금 없이 stale 상태로 읽으면 동시 삭제가 flush로 되살아나는(모든 컬럼 UPDATE) 문제 방지 - UpdateConversationTitleRequest의 @notblank 제거 — 공백 검증을 ConversationTitle 값 객체로 일원화(공백→INVALID_CONVERSATION_TITLE, 누락→INVALID_INPUT, 문서와 일치) - 공백 제목 HTTP 케이스 테스트 추가
|
대화방 제목 컬럼이 생기면서, 최초에 첫 메시지에 대해 대화방 생성을 할 때 클라이언트측에서 제목도 같이 전달해주는 흐름이 자연스럽다고 생각하는데 어떻게 생각하시나요? -> 클라와 논의된 사안인 것 확인했습니다! |
dev에 generation_log(V9)·인덱스(V10)가 머지되어 V9가 겹치므로 다음 번호(V11)로 조정
- 검색 대상·반환 제목을 conversations.title(클라이언트 지정 제목)로 변경. 이 PR 을 딴 뒤 dev 에 제목 컬럼(V11)과 지정 API(#54)가 들어왔는데 검색은 여전히 cards.summary 를 제목으로 보고 있어, 사용자가 붙인 제목으로는 검색이 안 됐다 - 카드 요약은 카드 표시 문구이지 대화방 제목이 아니므로 검색 대상에서 제외. ft_cards_summary 인덱스·cards LEFT JOIN·CardRepository.findByConversationIdIn 제거 - 삭제된 대화방을 검색에서 제외(status <> DELETED). 이 PR 을 딴 시점엔 삭제 API 가 없었고 이후 dev 에 생겨, 목록·캘린더와 달리 검색만 삭제된 방을 노출하고 있었다. native query 라 enum 바인딩이 적용되지 않아 String 으로 받는다(#70 에서 확인된 이슈) - ConversationSearchService 에 @transactional(readOnly = true) — 포트 구현이 리포지토리를 여러 번 호출하므로 한 트랜잭션·한 커넥션으로 묶는다 - 검색 엔드포인트 문서에 EXPIRED_TOKEN 행 추가(dev #77 이 다른 14곳에 적용한 규약)
🔗 연관 이슈
📌 개요
대화방에 제목을 둔다. 첫 생성 시에는 제목이 없고(null), 이후 클라이언트가 전용 API로 지정한다. 제목은 여러 번 수정할 수 있다. (카드 요약과는 무관한 독립 필드)
🔧 주요 변경사항
Conversation에 nullabletitle추가 — 새 대화방은title = nullConversationTitle(Nickname 패턴)로 감쌈Conversation.rename()— 여러 번 호출 가능, 삭제된 방은 차단(ensureNotDeleted)PATCH /api/conversations/{conversationId}/title(본인 대화방만)ConversationResponse에title포함ErrorCode.INVALID_CONVERSATION_TITLE추가🌐 API · DB 영향
PATCH /api/conversations/{conversationId}/title(body:{ title })conversations.title VARCHAR(100) NULL💬 리뷰 포인트
getOwnedConversation사용(삭제 가드는rename이 처리)미머지 브랜치(대화방 검색·대시보드)도 V9를 씀 — 둘 중 하나 머지되면 나머지 renumber 필요.
Summary by CodeRabbit
새로운 기능
버그 수정